package com.groupseven.backend.services.impl;

import com.groupseven.backend.domain.Assessment.AssessmentItem;
import com.groupseven.backend.domain.Assessment.AssessmentPlan;
import com.groupseven.backend.domain.Assessment.AssessmentResult;
import com.groupseven.backend.domain.Paper.Paper;
import com.groupseven.backend.domain.Patent.Patent;
import com.groupseven.backend.domain.PrizeProduct.PrizeProduct;
import com.groupseven.backend.domain.Program.Program;
import com.groupseven.backend.domain.Role.Role;
import com.groupseven.backend.domain.User.User;
import com.groupseven.backend.mapper.*;
import com.groupseven.backend.services.AssessmentService;
import com.groupseven.backend.test.DataEncode;
import com.groupseven.backend.util.DoubleUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.*;

@Transactional
@Service
public class AssessmentServiceImpl implements AssessmentService {
    @Autowired
    private AssessmentMapper assessmentMapper;
    @Autowired
    private ProgramMapper programMapper;
    @Autowired
    private PaperMapper paperMapper;
    @Autowired
    private PatentMapper patentMapper;
    @Autowired
    private PrizeProductMapper prizeProductMapper;
    @Autowired
    private UserMapper userMapper;
    @Autowired
    private DataEncode dataEncode;
    @Autowired
    private RoleMapper roleMapper;

    /**
     * @Author 王志华
     * @return
     */
   public List<AssessmentItem> getAllAssessmentItems(){
       return assessmentMapper.getAllAssessmentItems();
   }

    /**
     * @Author 王志华
     * @return
     */
   public List<AssessmentPlan> getAllAssessmentPlans(){
       return assessmentMapper.getAllAssessmentPlans();
   }

    /**
     * @Author 王志华
     * @param item
     * @return
     */
   public int addItemForPlanByPlanid(AssessmentItem item){
       return assessmentMapper.addItemForPlanByPlanid(item);
   }

    /**
     * @Author 王志华
     * @param Username
     * @param Planid
     * @return
     */
   public AssessmentResult getAssessmentScoreByUsernameAndPlanid(String Username, int Planid){
       double ProgramScore = 0;
       double PatentScore = 0;
       double AwardScore = 0;
       double PaperScore = 0;
       AssessmentResult asresult = new AssessmentResult();
       asresult.setUsername(Username);
       Map<Integer,Object> result = new HashMap<>();
       User user = userMapper.selectByUsername(dataEncode.encodeBae64(Username));
       int Usernum = user.getUsernum();
       List<AssessmentItem> Items = assessmentMapper.getItemsById(Planid);
       List<Program> MyPrograms = programMapper.selectByManager(Username);
       List<Patent> MyPatents = patentMapper.selectMyPatentsForAssessment(Username);
       List<Paper> MyPapers = paperMapper.selectMyPapersForAssessment(Username);
       List<PrizeProduct> MyAwards = prizeProductMapper.selectMyAwardsForAssessment(Username);
//       List<Paper> MyPapers = paperMapper.selectAllPapers();
//       List<Program> MyPrograms = programMapper.selectAllPrograms();
//       List<Patent> MyPatents = patentMapper.getallPatents();
//       List<PrizeProduct> MyAwards = prizeProductMapper.getallPrizeProduct();
       System.out.println("进入项目");
       System.out.println("--------------------");
       for(AssessmentItem assessIterator : Items){
           //项目
           if(assessIterator.getProjectType()==1){
               for(Program programIterator : MyPrograms) {
                   if(programIterator.getApprovalStatus()==3){
                       if (assessIterator.getProjectLevel() == programIterator.getLevel()) {
                           System.out.println(assessIterator.getProjectBasePoint());
                           System.out.println(assessIterator.getProjectLevelAddPoint());
                           ProgramScore=DoubleUtil.sum(ProgramScore,assessIterator.getProjectBasePoint());
                           ProgramScore=DoubleUtil.sum(ProgramScore,assessIterator.getProjectLevelAddPoint());
                       }
                       if (assessIterator.getConsiderManager() == 1 && programIterator.getManager().equals(Username)) {
                           System.out.println(assessIterator.getManagerAddPoints());
                           ProgramScore=DoubleUtil.sum(ProgramScore,assessIterator.getManagerAddPoints());
                       }
                   }
               }
               asresult.setProgramScore(ProgramScore);
               result.put(assessIterator.getProjectType(),ProgramScore);
               System.out.println("进入论文");
               System.out.println("--------------------");
           //论文
           } else if(assessIterator.getProjectType()==2){

               for(Paper paperIterator : MyPapers){
                   if (assessIterator.getProjectLevel() == paperIterator.getLevel()) {
                       System.out.println(assessIterator.getProjectBasePoint());
                       System.out.println(assessIterator.getProjectLevelAddPoint());
                       PaperScore=DoubleUtil.sum(PaperScore,assessIterator.getProjectBasePoint());
                       PaperScore=DoubleUtil.sum(PaperScore,assessIterator.getProjectLevelAddPoint());
                   }
                   if (assessIterator.getConsiderManager() == 1 && paperIterator.getUsername() == Username) {
                       System.out.println(assessIterator.getManagerAddPoints());
                       PaperScore=DoubleUtil.sum(PaperScore,assessIterator.getManagerAddPoints());
                   }
               }
               asresult.setPaperScore(PaperScore);
               result.put(assessIterator.getProjectType(),PaperScore);
               System.out.println("进入专利");
               System.out.println("--------------------");
           //专利
           } else if(assessIterator.getProjectType()==3){
               for(Patent patentIterator : MyPatents){
                   if (assessIterator.getProjectLevel() == patentIterator.getLevel()) {
                       System.out.println(assessIterator.getProjectBasePoint());
                       System.out.println(patentIterator.getPatentName()+' '+patentIterator.getLevel());
                       PatentScore=DoubleUtil.sum(PatentScore,assessIterator.getProjectBasePoint());
                       PatentScore=DoubleUtil.sum(PatentScore,assessIterator.getProjectLevelAddPoint());
                       System.out.println(assessIterator.getProjectLevelAddPoint());
                       System.out.println(PaperScore);
                   }
                   if (assessIterator.getConsiderManager() == 1 && patentIterator.getUsername()==Username) {
                       System.out.println(assessIterator.getManagerAddPoints());
                       PatentScore=DoubleUtil.sum(PatentScore,assessIterator.getManagerAddPoints());
                   }
               }
               asresult.setPatentScore(PatentScore);
               result.put(assessIterator.getProjectType(),PatentScore);
               System.out.println("进入获奖");
               System.out.println("--------------------");
           //获奖
           } else if(assessIterator.getProjectType()==4){
               for(PrizeProduct awardIterator : MyAwards){
                   if (assessIterator.getProjectLevel() == awardIterator.getLevel()) {
                       AwardScore=DoubleUtil.sum(AwardScore,assessIterator.getProjectBasePoint());
                       AwardScore=DoubleUtil.sum(AwardScore,assessIterator.getProjectLevelAddPoint());
                   }
               }
               asresult.setAwardScore(AwardScore);
               result.put(assessIterator.getProjectType(),AwardScore);
           }
       }
       asresult.setMyScore(DoubleUtil.sum(DoubleUtil.sum(asresult.getAwardScore(),asresult.getPaperScore()),DoubleUtil.sum(asresult.getPatentScore(),asresult.getProgramScore())));
       return asresult;
   }

    /**
     * @Author 王志华
     * @param Planid
     * @return
     */
   public List<AssessmentResult> getAssessmentScoreByPlanid(int Planid){
       List<User> users = userMapper.getAllUsers();
       List<AssessmentResult> results = new ArrayList<>();
       for(User userIterator : users){
           userIterator.setUserid(dataEncode.decodeBae64(userIterator.getUserid()));
           userIterator.setUsername(dataEncode.decodeBae64(userIterator.getUsername()));
           userIterator.setPassword(dataEncode.decodeBae64(userIterator.getPassword()));
       }
       Map<String,Map<Integer,Object>> finalResult = new HashMap<>();
       List<AssessmentItem> Items = assessmentMapper.getItemsById(Planid);
//       List<Program> MyPrograms = programMapper.selectMyProgramsForAssessment(Username);
//       List<Patent> MyPatents = patentMapper.selectMyPatentsForAssessment(Username);
//       List<Paper> MyPapers = paperMapper.selectMyPapersForAssessment(Username);
//       List<PrizeProduct> MyAwards = prizeProductMapper.selectMyAwardsForAssessment(Username);
//       List<Paper> MyPapers = paperMapper.selectAllPapers();
//       List<Program> MyPrograms = programMapper.selectAllPrograms();
//       List<Patent> MyPatents = patentMapper.getallPatents();
//       List<PrizeProduct> MyAwards = prizeProductMapper.getallPrizeProduct();
       for(User userIterator : users){
           double ProgramScore = 0;
           double PaperScore = 0;
           double PatentScore = 0;
           double AwardScore = 0;
           AssessmentResult asresult = new AssessmentResult();
           asresult.setUsername(userIterator.getUsername());
           asresult.setAffiliation(userIterator.getAffiliation());
           List<Program> MyPrograms = programMapper.selectByManager(userIterator.getUsername());
           List<Patent> MyPatents = patentMapper.selectMyPatentsForAssessment(userIterator.getUsername());
           List<Paper> MyPapers = paperMapper.selectMyPapersForAssessment(userIterator.getUsername());
           List<PrizeProduct> MyAwards = prizeProductMapper.selectMyAwardsForAssessment(userIterator.getUsername());
           if(MyAwards==null&&MyAwards.size()==0&&MyPapers==null&&MyPapers.size()==0&&MyPatents==null&&MyPatents.size()==0&&MyPrograms==null&&MyPrograms.size()==0){
               asresult.setAwardScore(0);
               asresult.setPaperScore(0);
               asresult.setPatentScore(0);
               asresult.setProgramScore(0);
               asresult.setMyScore(0);
               results.add(asresult);
               continue;
           }
           Map<Integer,Object> result = new HashMap<>();
           for(AssessmentItem assessIterator : Items){
               //项目
               if(assessIterator.getProjectType()==1){
                   for(Program programIterator : MyPrograms) {
                       if(programIterator.getApprovalStatus()==3){
                           if (assessIterator.getProjectLevel() == programIterator.getLevel()) {
                               System.out.println(assessIterator.getProjectBasePoint());
                               System.out.println(assessIterator.getProjectLevelAddPoint());
                               ProgramScore=DoubleUtil.sum(ProgramScore,assessIterator.getProjectBasePoint());
                               ProgramScore=DoubleUtil.sum(ProgramScore,assessIterator.getProjectLevelAddPoint());
                               if (assessIterator.getConsiderManager() == 1 && programIterator.getManager().equals(userIterator.getUsername())) {
                                   System.out.println(assessIterator.getManagerAddPoints());
                                   ProgramScore=DoubleUtil.sum(ProgramScore,assessIterator.getManagerAddPoints());
                               }
                           }
                       }
                   }
                   asresult.setProgramScore(ProgramScore);
                   result.put(assessIterator.getProjectType(),ProgramScore);
                   //论文
               } else if(assessIterator.getProjectType()==2){

                   for(Paper paperIterator : MyPapers){
                       if (assessIterator.getProjectLevel() == paperIterator.getLevel()) {
                           System.out.println(assessIterator.getProjectBasePoint());
                           System.out.println(assessIterator.getProjectLevelAddPoint());
                           PaperScore=DoubleUtil.sum(PaperScore,assessIterator.getProjectBasePoint());
                           PaperScore=DoubleUtil.sum(PaperScore,assessIterator.getProjectLevelAddPoint());
                           if (assessIterator.getConsiderManager() == 1 && paperIterator.getUsername() == userIterator.getUsername()) {
                               System.out.println(assessIterator.getManagerAddPoints());
                               PaperScore=DoubleUtil.sum(PaperScore,assessIterator.getManagerAddPoints());
                           }
                       }
                   }
                   asresult.setPaperScore(PaperScore);
                   result.put(assessIterator.getProjectType(),PaperScore);
                   //专利
               } else if(assessIterator.getProjectType()==3){
                   for(Patent patentIterator : MyPatents){
                       if (assessIterator.getProjectLevel() == patentIterator.getLevel()) {
                           System.out.println(assessIterator.getProjectBasePoint());
                           System.out.println(patentIterator.getPatentName()+' '+patentIterator.getLevel());
                           PatentScore=DoubleUtil.sum(PatentScore,assessIterator.getProjectBasePoint());
                           PatentScore=DoubleUtil.sum(PatentScore,assessIterator.getProjectLevelAddPoint());
                           System.out.println(assessIterator.getProjectLevelAddPoint());
                           System.out.println(PaperScore);
                           if (assessIterator.getConsiderManager() == 1 && patentIterator.getUsername()==userIterator.getUsername()) {
                               System.out.println(assessIterator.getManagerAddPoints());
                               PatentScore=DoubleUtil.sum(PatentScore,assessIterator.getManagerAddPoints());
                           }
                       }
                   }
                   asresult.setPatentScore(PatentScore);
                   result.put(assessIterator.getProjectType(),PatentScore);
                   //获奖
               } else if(assessIterator.getProjectType()==4){
                   for(PrizeProduct awardIterator : MyAwards){
                       if (assessIterator.getProjectLevel() == awardIterator.getLevel()) {
                           AwardScore=DoubleUtil.sum(AwardScore,assessIterator.getProjectBasePoint());
                           AwardScore=DoubleUtil.sum(AwardScore,assessIterator.getProjectLevelAddPoint());
                       }
                   }
                   asresult.setAwardScore(AwardScore);
                   result.put(assessIterator.getProjectType(),AwardScore);
               }
           }
           asresult.setMyScore(DoubleUtil.sum(DoubleUtil.sum(asresult.getAwardScore(),asresult.getPaperScore()),DoubleUtil.sum(asresult.getPatentScore(),asresult.getProgramScore())));
           results.add(asresult);
           finalResult.put(userIterator.getUsername(),result);
       }
        return results;
   }


   public List<AssessmentResult> getAssessmentScoreByPlanidAndStartTime(int Planid, Date StartTime){
       System.out.println("进入考核算分----------------------------------------");
//       Calendar start = Calendar.getInstance();
//       start.setTime(StartTime);
//       StartTime = start.getTime();
       System.out.println(StartTime);
       List<User> users = userMapper.getAllUsers();
       List<AssessmentResult> results = new ArrayList<>();
       List<Role> rolelist = roleMapper.getAllRoles();
       for(User userIterator : users){
           userIterator.setUserid(dataEncode.decodeBae64(userIterator.getUserid()));
           userIterator.setUsername(dataEncode.decodeBae64(userIterator.getUsername()));
           userIterator.setPassword(dataEncode.decodeBae64(userIterator.getPassword()));
       }
       Map<String,Map<Integer,Object>> finalResult = new HashMap<>();
       List<AssessmentItem> Items = assessmentMapper.getItemsById(Planid);
       for(User userIterator : users){
           for(Role roleIterator : rolelist){
               if(userIterator.getUsertype()==roleIterator.getRolenumber()){
                   System.out.println("开始算用户【"+userIterator.getUsername()+"】角色【"+roleIterator.getRolename()+"】的分数");
                   System.out.println("-----------------------------------------------------------------------");
                   double ProgramScore = 0;
                   double PaperScore = 0;
                   double PatentScore = 0;
                   double AwardScore = 0;
                   Calendar end = Calendar.getInstance();
                   end.setTime(StartTime);
                   end.add(Calendar.YEAR,roleIterator.getAssessmentCycle());
                   Date EndTime = end.getTime();
                   System.out.println("EndTime是："+EndTime);
                   AssessmentResult asresult = new AssessmentResult();
                   asresult.setUsername(userIterator.getUsername());
                   asresult.setAffiliation(userIterator.getAffiliation());
                   List<Program> MyPrograms = programMapper.selectByManager(userIterator.getUsername());
                   List<Patent> MyPatents = patentMapper.selectMyPatentsForAssessment(userIterator.getUsername());
                   List<Paper> MyPapers = paperMapper.selectMyPapersForAssessment(userIterator.getUsername());
                   List<PrizeProduct> MyAwards = prizeProductMapper.selectMyAwardsForAssessment(userIterator.getUsername());
                   if(MyAwards==null&&MyAwards.size()==0&&MyPapers==null&&MyPapers.size()==0&&MyPatents==null&&MyPatents.size()==0&&MyPrograms==null&&MyPrograms.size()==0){
                       asresult.setAwardScore(0);
                       asresult.setPaperScore(0);
                       asresult.setPatentScore(0);
                       asresult.setProgramScore(0);
                       asresult.setMyScore(0);
                       results.add(asresult);
                       continue;
                   }
                   Map<Integer,Object> result = new HashMap<>();
                   for(AssessmentItem assessIterator : Items){
                       //项目
                       if(assessIterator.getProjectType()==1){
                           for(Program programIterator : MyPrograms) {
                               if(programIterator.getApprovalStatus()==3){
//                                   Calendar programStartTime = Calendar.getInstance();
//                                   programStartTime.setTime(programIterator.getStartTime());
//                                   Calendar programEndTime = Calendar.getInstance();
//                                   programEndTime.setTime(programIterator.getStartTime());
                                   System.out.println("---------------------");
                                   System.out.println("项目名称："+programIterator.getProgramname());
                                   System.out.println("项目开始时间："+programIterator.getStartTime());
                                   System.out.println("项目结束时间："+programIterator.getEndTime());
                                   System.out.println("---------------------");
                                   if (assessIterator.getProjectLevel() == programIterator.getLevel()&&programIterator.getStartTime().after(StartTime)&&programIterator.getStartTime().before(EndTime)) {
                                       System.out.println(assessIterator.getProjectBasePoint());
                                       System.out.println(assessIterator.getProjectLevelAddPoint());
                                       ProgramScore=DoubleUtil.sum(ProgramScore,assessIterator.getProjectBasePoint());
                                       ProgramScore=DoubleUtil.sum(ProgramScore,assessIterator.getProjectLevelAddPoint());
                                       if (assessIterator.getConsiderManager() == 1 && programIterator.getManager().equals(userIterator.getUsername())) {
                                           System.out.println(assessIterator.getManagerAddPoints());
                                           ProgramScore=DoubleUtil.sum(ProgramScore,assessIterator.getManagerAddPoints());
                                       }
                                       if(programIterator.getEndTime()!=null){
                                           if(programIterator.getEndTime().before(EndTime)){
                                               ProgramScore=DoubleUtil.sum(ProgramScore,assessIterator.getExtraPoints());
                                           }
                                       }
                                   }
                               }
                           }
                           asresult.setProgramScore(ProgramScore);
                           result.put(assessIterator.getProjectType(),ProgramScore);
                           //论文
                       } else if(assessIterator.getProjectType()==2){

                           for(Paper paperIterator : MyPapers){
//                               Calendar paperStartTime = Calendar.getInstance();
//                               paperStartTime.setTime(paperIterator.getStartTime());
//                               Calendar paperEndTime = Calendar.getInstance();
//                               paperEndTime.setTime(paperIterator.getEndTime());
                               if (assessIterator.getProjectLevel() == paperIterator.getLevel()&&paperIterator.getStartTime().after(StartTime)&&paperIterator.getStartTime().before(EndTime)) {
                                   System.out.println(assessIterator.getProjectBasePoint());
                                   System.out.println(assessIterator.getProjectLevelAddPoint());
                                   PaperScore=DoubleUtil.sum(PaperScore,assessIterator.getProjectBasePoint());
                                   PaperScore=DoubleUtil.sum(PaperScore,assessIterator.getProjectLevelAddPoint());
                                   if (assessIterator.getConsiderManager() == 1 && paperIterator.getUsername() == userIterator.getUsername()) {
                                       System.out.println(assessIterator.getManagerAddPoints());
                                       PaperScore=DoubleUtil.sum(PaperScore,assessIterator.getManagerAddPoints());
                                   }
                                   if(paperIterator.getEndTime()!=null){
                                       if(paperIterator.getEndTime().before(EndTime)){
                                           PaperScore=DoubleUtil.sum(PaperScore,assessIterator.getExtraPoints());
                                       }
                                   }
                               }
                           }
                           asresult.setPaperScore(PaperScore);
                           result.put(assessIterator.getProjectType(),PaperScore);
                           //专利
                       } else if(assessIterator.getProjectType()==3){
                           for(Patent patentIterator : MyPatents){
//                               Calendar patentStartTime = Calendar.getInstance();
//                               patentStartTime.setTime(patentIterator.getStartTime());
//                               try {
//                                   Calendar patentEndTime = Calendar.getInstance();
//                                   patentEndTime.setTime(patentIterator.getEndTime());
//                               } catch (Exception e){
//                                   Calendar patentEndTime = null;
//                               }
                               if (assessIterator.getProjectLevel() == patentIterator.getLevel()&&patentIterator.getStartTime().after(StartTime)&&patentIterator.getStartTime().before(EndTime)) {
                                   System.out.println(assessIterator.getProjectBasePoint());
                                   System.out.println(patentIterator.getPatentName()+' '+patentIterator.getLevel());
                                   PatentScore=DoubleUtil.sum(PatentScore,assessIterator.getProjectBasePoint());
                                   PatentScore=DoubleUtil.sum(PatentScore,assessIterator.getProjectLevelAddPoint());
                                   System.out.println(assessIterator.getProjectLevelAddPoint());
                                   System.out.println(PaperScore);
                                   if (assessIterator.getConsiderManager() == 1 && patentIterator.getUsername()==userIterator.getUsername()) {
                                       System.out.println(assessIterator.getManagerAddPoints());
                                       PatentScore=DoubleUtil.sum(PatentScore,assessIterator.getManagerAddPoints());
                                   }
                                   if(patentIterator.getEndTime()!=null){
                                       if(patentIterator.getEndTime().before(EndTime)){
                                           PatentScore=DoubleUtil.sum(PatentScore,assessIterator.getExtraPoints());
                                       }
                                   }
                               }
                           }
                           asresult.setPatentScore(PatentScore);
                           result.put(assessIterator.getProjectType(),PatentScore);
                           //获奖
                       } else if(assessIterator.getProjectType()==4){
                           for(PrizeProduct awardIterator : MyAwards){
//                               Calendar awardStartTime = Calendar.getInstance();
//                               awardStartTime.setTime(awardIterator.getStartTime());
//                               Calendar awardEndTime = Calendar.getInstance();
//                               awardEndTime.setTime(awardIterator.getEndTime());
                               if (assessIterator.getProjectLevel() == awardIterator.getLevel()&&awardIterator.getStartTime().after(StartTime)&&awardIterator.getStartTime().before(EndTime)) {
                                   AwardScore=DoubleUtil.sum(AwardScore,assessIterator.getProjectBasePoint());
                                   AwardScore=DoubleUtil.sum(AwardScore,assessIterator.getProjectLevelAddPoint());
                               }
                               if(awardIterator.getEndTime()!=null){
                                   if(awardIterator.getEndTime().before(EndTime)){
                                       AwardScore=DoubleUtil.sum(AwardScore,assessIterator.getExtraPoints());
                                   }
                               }
                           }
                           asresult.setAwardScore(AwardScore);
                           result.put(assessIterator.getProjectType(),AwardScore);
                       }
                   }
                   asresult.setMyScore(DoubleUtil.sum(DoubleUtil.sum(asresult.getAwardScore(),asresult.getPaperScore()),DoubleUtil.sum(asresult.getPatentScore(),asresult.getProgramScore())));
                   results.add(asresult);
                   finalResult.put(userIterator.getUsername(),result);
               }
           }
       }
       System.out.println("退出考核算分----------------------------------------");
       return results;
   }

    /**
     * @Author 王志华
     * @param item
     * @return
     */
    public boolean checkAddForPlanItem(AssessmentItem item){
        List<AssessmentItem> tmp = assessmentMapper.selectByProjectTypeAndLevelAndBelonging(item.getProjectType(),item.getProjectLevel(),item.getBelonging());
        if(tmp!=null&&tmp.size()!=0){
            return false;
        }
        return true;
    }

    /**
     * @Author 王志华
     * @param id
     * @return
     */
    public int deleteAssessmentItemById(int id){
        return assessmentMapper.deleteAssessmentItemById(id);
    }

    /**
     * @Author 王志华
     * @param id
     * @return
     */
    public int deleteAssessmentPlanById(int id){
        return assessmentMapper.deleteAssessmentPlanById(id);
    }

    /**
     * @Author 王志华
     * @param item
     * @return
     */
    public boolean updateAssessmentItem(AssessmentItem item){
        int tmp = assessmentMapper.updateAssessmentItem(item);
        if(tmp==0){
            return false;
        }
        return true;
    }

    /**
     * @Author 王志华
     * @param Planid
     * @return
     */
    public List<AssessmentItem> getItemsByPlanid(int Planid){
        return assessmentMapper.getItemsById(Planid);
    }
}
